-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a public og:description meta tag #643
Add a public og:description meta tag #643
Conversation
Let's use
Instead then. You don't need to do anything with the l10n files, it will be handled automatically. |
I'm not sure I understand — you're telling me that there is an automatic translation engine in place behind the diff --git a/templates/main.php b/templates/main.php
/* OpenGraph */
if($_['isPublic']) {
OCP\Util::addHeader('meta', ['property' => "og:title", 'content' => $theme->getName() . ' - ' . $theme->getSlogan()]);
- OCP\Util::addHeader('meta', ['property' => "og:description", 'content' => $l->t('Public access')]);
+ OCP\Util::addHeader('meta', ['property' => "og:description", 'content' => $l->t('Someone has shared a public link to a calendar on %s', [$theme->getName()])]);
OCP\Util::addHeader('meta', ['property' => "og:site_name", 'content' => $theme->getName()]);
OCP\Util::addHeader('meta', ['property' => "og:url", 'content' => $_['shareURL']]);
OCP\Util::addHeader('meta', ['property' => "og:type", 'content' => "object"]); |
That is exactly what he meant ;) Nextcloud uses Transifex for handling translations, so strings to be translated are collected by transifex, translated there and pushed back to the repo. No need to translate anything here. |
We can be more specific, no? Instead of the bland
let’s go with
The important things are the name of the sharer and the calendar name. :) |
I’m afraid this is not that easy at the moment. We only get the sharer name and display name of the calendar after sending some CalDAV requests in JavaScript. We will have to implement some API in the dav app for that |
Then yeah, let's implement that to make it happen. ;) "Someone shared …" is really a bit strange. |
Just a quick update: I didn't take the time to implement the above yet, but I just wanted to let you all know that I (partly) fixed the issue on the Synapse side of things (Riot.fm is powered by Synapse): matrix-org/synapse#2576. |
@maximevaillancourt do you need any help with this? Feel free to ask. :) |
Closing in favour of #609 See for updated information. |
What are you trying to achieve with this PR?
Fix #609. By adding the
og:description
meta tag on public templates, sites such as Riot.im (powered by Synapse) now use the Open Graph content instead of scraping the text nodes on the page, thus offering a better experience for users who receive a shared calendar link.Why are you going with this approach?
I placed the
og:description
with the other Open Graph tags to keep them all together.Discussion
Couldn't we show the shared calendar's detailed information?
We could move
og:description
inpart.publicinformations.php
to offer detailed calendar information such as the calendar name, its owner, and the user who shared it. However, I could not get this approach to work since it requires string interpolation with Angular'sng-repeat
directive, which (I think) has no easy way to integrate with NextCloud's string translation method ($l->t(...)
).Okay, but couldn't we provide a better string instead of just "Public access"?
Absolutely. It would require creating a new string in the
l10n
files, something along those lines: "Someone has shared a public link to a calendar on$theme->getName()
".